package com.rc.saas.tenant.service.shop;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.shop.ShopStockRecordMapper;
import com.rc.saas.tenant.search.shop.ShopStockRecordSearch;
import com.rc.saas.tenant.vo.shop.ShopOrderHistoryVo;
import com.rc.saas.tenant.vo.shop.ShopStockRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopStockRecordServiceImpl implements ShopStockRecordService {
    @Autowired
    private ShopStockRecordMapper shopStockRecordMapper;

    @Override
    public ShopStockRecordMapper getMapper() {
        return shopStockRecordMapper;
    }

    @Override
    public PageInfo<ShopStockRecordVo> listPageByConditionWithHistory(ShopStockRecordSearch shopStockRecordSearch) {
        PageHelper.startPage(shopStockRecordSearch.getOffset(), shopStockRecordSearch.getLimit());
        List<ShopStockRecordVo> shopOrderResultVos = shopStockRecordMapper.listPageByConditionWithHistory(shopStockRecordSearch);
        return new PageInfo<>(shopOrderResultVos);
    }
}
